home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gscindex.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.1 KB  |  80 lines

  1. /* Copyright (C) 2000 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gscindex.h,v 1.2 2000/09/19 19:00:26 lpd Exp $ */
  20. /* Client interface to Indexed color facilities */
  21.  
  22. #ifndef gscindex_INCLUDED
  23. #  define gscindex_INCLUDED
  24.  
  25. #include "gscspace.h"
  26.  
  27. /*
  28.  * Indexed color spaces.
  29.  *
  30.  * If the color space will use a procedure rather than a byte table,
  31.  * ptbl should be set to 0.
  32.  *
  33.  * Unlike most of the other color space constructors, this one initializes
  34.  * some of the fields of the colorspace. In the case in which a string table
  35.  * is used for mapping, it initializes the entire structure. Note that the
  36.  * client is responsible for the table memory in that case; the color space
  37.  * will not free it when the color space itself is released.
  38.  *
  39.  * For the case of an indexed color space based on a procedure, a default
  40.  * procedure will be provided that simply echoes the color values already in
  41.  * the palette; the client may override these procedures by use of
  42.  * gs_cspace_indexed_set_proc. If the client wishes to insert values into
  43.  * the palette, it should do so by using gs_cspace_indexed_value_array, and
  44.  * directly inserting the desired values into the array.
  45.  *
  46.  * If the client does insert values into the palette directly, the default
  47.  * procedures provided by the client are fairly efficient, and there are
  48.  * few instances in which the client would need to replace them.
  49.  */
  50. extern int gs_cspace_build_Indexed(P5(
  51.                       gs_color_space ** ppcspace,
  52.                       const gs_color_space * pbase_cspace,
  53.                       uint num_entries,
  54.                       const gs_const_string * ptbl,
  55.                       gs_memory_t * pmem
  56.                       ));
  57.  
  58. /* Return the number of entries in the palette of an indexed color space. */
  59. extern int gs_cspace_indexed_num_entries(P1(
  60.                            const gs_color_space * pcspace
  61.                      ));
  62.  
  63. /* In the case of a procedure-based indexed color space, get a pointer to */
  64. /* the array of cached values. */
  65. extern float *gs_cspace_indexed_value_array(P1(
  66.                           const gs_color_space * pcspace
  67.                         ));
  68.  
  69. /* Set the lookup procedure to be used for an Indexed color space. */
  70. extern int gs_cspace_indexed_set_proc(P2(
  71.                         gs_color_space * pcspace,
  72.            int (*proc) (P3(const gs_indexed_params *, int, float *))
  73.                       ));
  74.  
  75. /* Look up an index in an Indexed color space. */
  76. int gs_cspace_indexed_lookup(P3(const gs_indexed_params *, int,
  77.                 gs_client_color *));
  78.  
  79. #endif /* gscindex_INCLUDED */
  80.